package com.bnzjy.srb.core.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.CreditCardNumber;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * <p>
 * 用户绑定表
 * </p>
 *
 * @author Helen
 * @since 2021-12-13
 */
@Data
@Valid
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="UserBind对象", description="用户绑定表")
public class UserBind implements Serializable {

    private static final long serialVersionUID = 1L;
    
    @ApiModelProperty(value = "编号")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "用户id")
    private Long userId;
    
    @NotNull(message = "用户姓名不能为空")
    @ApiModelProperty(value = "用户姓名")
    private String name;
    
    @NotNull
    @Length(min = 18)
    @Pattern(regexp = "^(\\d{18,18}|\\d{15,15}|(\\d{17,17}[x|X]))$", message="身份证格式错误")
    @ApiModelProperty(value = "身份证号")
    private String idCard;
    
    @CreditCardNumber
    @ApiModelProperty(value = "银行卡号")
    private String bankNo;

    @NotNull
    @Length(min = 15)
    @ApiModelProperty(value = "银行类型")
    private String bankType;
    
    @NotNull
    @Length(min = 11)
    @Pattern(regexp = "^((13[0-9])|(15[^4,\\D])|(17[0-9])|(18[0-9]))\\d{8}$")
    @ApiModelProperty(value = "手机号")
    private String mobile;

    @ApiModelProperty(value = "绑定账户协议号")
    private String bindCode;

    @ApiModelProperty(value = "状态")
    private Integer status;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "逻辑删除(1:已删除，0:未删除)")
    @TableField("is_deleted")
    @TableLogic
    private Boolean deleted;


}
